package com.xzx.mr.io;

import com.xzx.mr.kv.AnalysisKey;
import com.xzx.mr.kv.AnalysisValue;
import org.apache.hadoop.mapreduce.*;

import java.io.IOException;

/**
 * @author xinzhixuan
 * @version 1.0
 * @date 2024/8/10 18:26
 */
public class MysqlOutputFormat extends OutputFormat<AnalysisKey, AnalysisValue> {
    @Override
    public RecordWriter<AnalysisKey, AnalysisValue> getRecordWriter(TaskAttemptContext context) throws IOException, InterruptedException {
        return new MysqlWriter();
    }

    @Override
    public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException {

    }

    @Override
    public OutputCommitter getOutputCommitter(TaskAttemptContext context) throws IOException, InterruptedException {
        return new MysqlCommitter();
    }
}
